from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, BooleanField, PasswordField
from wtforms.validators import DataRequired, Length


class LoginForm(FlaskForm):
    userid = StringField(label='账号', validators=[DataRequired(), Length(5, 5)],
                         render_kw={'class': 'form-control', 'placeholder': '请输入账号'})
    password = PasswordField(label='密码', validators=[DataRequired(), Length(6, 20)],
                             render_kw={'class': 'form-control', 'placeholder': '请输入密码'})
    remember = BooleanField(label='记住我', render_kw={'checked': 'checked'})
    submit = SubmitField(label='登 录', render_kw={'class': 'btn btn-primary'})
